﻿<Window x:Class="ImageTagTool.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:ImageTagTool"
        xmlns:conv="clr-namespace:ImageTagTool.ValueConverters"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        Title="Image Tag Tool" Height="540" Width="960" WindowStartupLocation="CenterScreen">
    <Window.Resources>
        <conv:VisibilityToBoolConverter x:Key="v2bConverter" />
    </Window.Resources>
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Closing">
            <i:InvokeCommandAction Command="{Binding CloseButtonClicked}" />
        </i:EventTrigger>
        <i:EventTrigger EventName="Loaded">
            <i:InvokeCommandAction Command="{Binding WindowLoaded}" />
        </i:EventTrigger>
    </i:Interaction.Triggers>
    <Grid>
        <Menu Height="23" Name="MainMenu" VerticalAlignment="Top" Margin="0,0,679,0">
            <MenuItem Header="File">
                <MenuItem Header="New" Command="{Binding NewMenuItemClicked}"/>
                <MenuItem Header="Add other location" Command="{Binding AddOtherLocationMenuItemClicked}" IsEnabled="{Binding Path=ContextRelatedMenuItemsEnabled, Mode=OneWay}"/>
                <Separator />
                <MenuItem Header="Open" IsEnabled="{Binding Path=ContextRelatedMenuItemsEnabled, Mode=OneWay}"/>
                <Separator />
                <MenuItem Header="Export" IsEnabled="False">
                    <MenuItem Header="XML" />
                    <MenuItem Header="JSON" />
                </MenuItem>
                <Separator />
                <MenuItem Header="Close" Command="{Binding CloseMenuItemClicked}"/>
            </MenuItem>
            <MenuItem Header="Tools" />
            <MenuItem Header="Help">
                <MenuItem Header="Approximate memory usage" Command="{Binding ApproximateMemoryUsageClicked}"/>
                <MenuItem Header="About" Command="{Binding AboutMenuItemClicked}"/>
            </MenuItem>
        </Menu>
        <local:ZoomBorder x:Name="ZoomBorder" ClipToBounds="True" Background="#FFE2E2E2" Margin="259,23,0,23">
            <Image Name="MainImage" />
        </local:ZoomBorder>
        <StatusBar Name="statusBar1" Height="23" VerticalAlignment="Bottom">
            <StatusBarItem Name="CounterStatusBarItem" Content="{Binding Path=StatusBarCounter, Mode=OneWay}"/>
            <StatusBarItem Name="ResolutionStatusBarItem" Content="{Binding Path=StatusBarResolution, Mode=OneWay}"/>
            <StatusBarItem Name="SizeStatusBarItem" Content="{Binding Path=StatusBarSize, Mode=OneWay}"/>
            <StatusBarItem Name="LoadStatusBarItem">
                <StatusBarItem.Content>
                    <ProgressBar Name="LoadProgressBar" Width="100" Height="16" Visibility="{Binding Path=LoadProgressBarVisibility, Converter={StaticResource v2bConverter},Mode=OneWay}" Value="{Binding Path=LoadProgressBarValue,Mode=OneWay}" />
                </StatusBarItem.Content>
            </StatusBarItem>
        </StatusBar>
        <GroupBox Header="General data" Height="193" Margin="0,23,0,0" Name="GeneralGroupBox" VerticalAlignment="Top" IsEnabled="{Binding Path=GeneralDataGroupBoxEnabled, Mode=OneWay}" HorizontalAlignment="Left" Width="253">
            <Grid>
                <Label Content="Name" Height="28" HorizontalAlignment="Left" Margin="6,6,0,0" Name="NameLabel" VerticalAlignment="Top" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="54,8,0,0" Name="NameTextBox" VerticalAlignment="Top" Width="181" IsReadOnly="True" Text="{Binding Path=NameTextBoxText, Mode=OneWay}"/>
                <Label Content="Rating" Height="28" HorizontalAlignment="Left" Margin="6,40,0,0" Name="RatingLabel" VerticalAlignment="Top" />
                <Slider Height="23" HorizontalAlignment="Left" Margin="54,45,0,0" Name="RatingSlider" VerticalAlignment="Top" Width="181" Value="{Binding Path=RatingSliderValue}" SmallChange="0.5" Minimum="1" Maximum="5" TickPlacement="BottomRight" AutoToolTipPlacement="BottomRight" IsSnapToTickEnabled="True" TickFrequency="0.5" AutoToolTipPrecision="1" />
            </Grid>
        </GroupBox>
        <GroupBox Header="Tags" Margin="0,251,0,23" Name="TagGroupBox" HorizontalAlignment="Left" Width="253" IsEnabled="{Binding Path=TagsGroupBoxEnabled, Mode=OneWay}">
            <Grid>
                <Label Content="Tag:" Height="28" HorizontalAlignment="Left" Margin="6,33,0,0" Name="label1" VerticalAlignment="Top" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="85,35,0,0" Name="TagTextBox" VerticalAlignment="Top" Width="150" Text="{Binding Path=TagTextBoxText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" PreviewKeyDown="TagTextBox_PreviewKeyDown" />
                <Label Content="DB-tags:" Height="28" HorizontalAlignment="Left" Margin="6,67,0,0" Name="label2" VerticalAlignment="Top" />
                <ListBox Height="60" HorizontalAlignment="Left" Margin="85,67,0,0" Name="DBTagsListBox" VerticalAlignment="Top" Width="150" ItemsSource="{Binding Path=DBTagsList, Mode=OneWay}" PreviewMouseDoubleClick="DBTagsListBox_PreviewMouseDoubleClick">
                    <ListBox.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="Remove tag" Name="RemoveTagContextMenuItem" Click="RemoveTagContextMenuItem_Click" />
                        </ContextMenu>
                    </ListBox.ContextMenu>
                </ListBox>
                <ListBox Height="60" HorizontalAlignment="Left" Margin="85,133,0,0" Name="TagListBox" VerticalAlignment="Top" Width="150" ItemsSource="{Binding Path=ImageTagsList, Mode=OneWay}" PreviewMouseDoubleClick="TagListBox_PreviewMouseDoubleClick" />
                <Label Content="Tags:" Height="28" HorizontalAlignment="Left" Margin="6,133,0,0" Name="label3" VerticalAlignment="Top" />
                <RadioButton Content="Scene" Height="16" HorizontalAlignment="Left" Margin="6,6,0,0" Name="SceneRadioButton" VerticalAlignment="Top" IsChecked="True" Command="{Binding SceneRadioButtonClicked}" />
                <RadioButton Content="Person" Height="16" HorizontalAlignment="Left" Margin="59,6,0,0" Name="PersonRadioButton" VerticalAlignment="Top" Command="{Binding PersonRadioButtonClicked}" />
                <RadioButton Content="Other" Height="16" HorizontalAlignment="Left" Margin="122,6,0,0" Name="OtherRadioButton" VerticalAlignment="Top" Command="{Binding OtherRadioButtonClicked}" />
            </Grid>
        </GroupBox>
        <Button Content="Next" Height="23" HorizontalAlignment="Left" Margin="172,222,0,0" Name="NextButton" VerticalAlignment="Top" Width="75" Command="{Binding NextButtonClicked}" IsEnabled="{Binding Path=NextButtonIsEnabled, Mode=OneWay}"/>
        <Button Content="Previous" Height="23" HorizontalAlignment="Left" Margin="91,222,0,0" Name="PreviousButton" VerticalAlignment="Top" Width="75" Command="{Binding PreviousButtonClicked}" IsEnabled="{Binding Path=PreviousButtonIsEnabled, Mode=OneWay}"/>
        <Menu Margin="259,0,0,0" Name="ImageMenu" Height="23" VerticalAlignment="Top">
            <MenuItem Name="ToFullSizeMenuItem" Header="To full size" Command="{Binding ToFullSizeMenuItemClicked}" />
        </Menu>
    </Grid>
</Window>
